<%@ page import="myapp.Device" %>

<div class="fieldcontain ${hasErrors(bean: deviceInstance, field: 'deviceId', 'error')} ">
	<label for="deviceId">
		<g:message code="device.deviceId.label" default="Device Id" />
		
	</label>
	<g:textField name="deviceId" value="${deviceInstance?.deviceId}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: deviceInstance, field: 'type', 'error')} ">
	<label for="type">
		<g:message code="device.type.label" default="Type" />
		
	</label>
	<g:textField name="type" value="${deviceInstance?.type}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: deviceInstance, field: 'active', 'error')} ">
	<label for="active">
		<g:message code="device.active.label" default="Active" />
		
	</label>
	<g:checkBox name="active" value="${deviceInstance?.active}" />
</div>

<div class="fieldcontain ${hasErrors(bean: deviceInstance, field: 'user', 'error')} required">
	<label for="user">
		<g:message code="device.user.label" default="User" />
		<span class="required-indicator">*</span>
	</label>
	<g:select id="user" name="user.id" from="${myapp.User.list()}" optionKey="id" required="" value="${deviceInstance?.user?.id}" class="many-to-one"/>
</div>

<div class="fieldcontain ${hasErrors(bean: deviceInstance, field: 'tag', 'error')} required">
	<label for="tag">
		<g:message code="device.tag.label" default="Tag" />
		<span class="required-indicator">*</span>
	</label>
	<g:select id="tag" name="tag.id" from="${myapp.Tag.list()}" optionKey="id" required="" value="${deviceInstance?.tag?.id}" class="many-to-one"/>
</div>

<div class="fieldcontain ${hasErrors(bean: deviceInstance, field: 'alias', 'error')} required">
	<label for="alias">
		<g:message code="device.alias.label" default="Alias" />
		<span class="required-indicator">*</span>
	</label>
	<g:select id="alias" name="alias.id" from="${myapp.Alias.list()}" optionKey="id" required="" value="${deviceInstance?.alias?.id}" class="many-to-one"/>
</div>